const METHOD = {POST: 'POST', GET: 'GET'}
const ContentType = {JSON: 'JSON', FORM: 'FORM'}
let BASE_SERVER, JT2_SERVER, GATEWAY_SERVER, JR_GATEWAY_SERVER, FICC_SERVER, DRS_SERVER,shareUrl,configHeight,configColorType
function initApi() {
  // JT2请求地址
  BASE_SERVER = `${systemConfig.server.jt2}`
  JT2_SERVER = `${systemConfig.server.jt2}/customer/app`
  // 网关地址
  GATEWAY_SERVER = `${systemConfig.server.gateWay}/gateway/api/jtzx/app/v1`
  // 金融网关网关地址
  JR_GATEWAY_SERVER = 'https://ms.jr.jd.com' // BASE_SERVER // 测试 'http://mstest.jr.jd.com' //生产地址 ms.jr.jd.com
  FICC_SERVER = 'https://ficc.jd.com/ficc'
  DRS_SERVER = `${systemConfig.server.jt2}/customer/drs`
  //测试接口基础地址
  // testurl = 'https://zzb-app.fulan.com.cn'
  // testurl = 'http://zzb-app.fulan.com.cn'
  // testurl = 'https://zzb.jd.com'
  // testurl = 'http://192.168.0.130'
  testurl = `${systemConfig.server.apiUrl}` // 测试/生产环境都用此地址
  // testurl = ``  // 本地启动nginx地址
  // testurl = `http://dev.jd.com:82`
  // testurl = `http://dev.jddglobal.com:82`

  //本地的Ip
  // localurl = 'http://192.168.8.137:8151'
  localurl = 'http://zzbzzb.cn.utools.club'

  localurlip = 'http://10.128.32.233'

  qzurlip = 'http://192.168.8.137'
  // qzurlip = 'http://192.168.43.234'
  //外部连接
  elseurl = 'https://jt2.jd.com'

  // //分享地址
  shareUrl = `${systemConfig.server.apiUrl}`
  // shareUrl = 'http://zzb-app.fulan.com.cn'
  //是否全屏并且获取得高度
  configHeight = `${systemConfig.statusBarHeight}`
  // configHeight = 0.4
  //是否开启深色模式
  configColorType = `${systemConfig.themeType}`
  // configColorType = '1'
}
// let shareUrl = `${shareUrl}`
// const shareUrl = 'https://zzb.jddglobal.com'
// const shareUrl = 'http://zzb-app.fulan.com.cn'
/**
 * 请求配置
 * key： 请求Key
 * value： {
 *   url: 请求地址，必选
 *   method：请求方式：可选，默认POST
 *   contentType: 请求类型，默认json
 *   crypto：是否使用信道加密，走网关的接口都需要加密，可选，默认不加密
 *   cache：请求是否本地缓存，可选 {
 *          preKey: string,缓存key的前缀,必选
 *          cacheKey: string,根据这个key从入参中获取生成缓存key的数据,必选
 *          checkKey: string,根据这个key从缓存数据，返回数据中获取校验值,必选
 *          postKey: string,提交到后台的参数名,必选
 *          }
 *        }
 */
const Server = {
  weiXinSign: () => {
    let url = window.location.href.split('#')[0]
    let nonceStr = Math.random().toString(32).substr(2) + Math.random().toString(32).substr(2)
    let timestamp = parseInt(new Date().getTime() / 1000)
    jsBridge.http(`${testurl}/customer/web/weixin/sign`, {
      url,
      nonceStr,
      timestamp
    }, {
      contentType: ContentType.FORM,
      method: METHOD.GET
    }).then(({appId, sign}) => {
      wx && wx.config({
        debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
        appId: appId, // 必填，公众号的唯一标识
        signature: sign,// 必填，签名
        nonceStr: nonceStr, // 必填，生成签名的随机串
        timestamp: timestamp, // 必填，生成签名的时间戳
        jsApiList: ['updateAppMessageShareData', 'updateTimelineShareData'] // 必填，需要使用的JS接口列表
      })
    })
  },
  //查询最新版本
  getVersion:{
    getnewversion:data => jsBridge.http(`${testurl}/customer/app/common/getVersionDetail`,data, {
      crypto: false
    }),
  },
  //我的
  myowninfo:{
    //我的收藏
    collectionList:data => jsBridge.http(`${testurl}/customer/app/information/selectCollectionListByType`,data, {
      crypto: false
    }),
    //用户反馈
    myfeedback:data => jsBridge.http(`${testurl}/customer/app/feedback/getFeedbackList`,data, {
      crypto: false
    }),
    //反馈详情
    myfeedbackdetail:data => jsBridge.http(`${testurl}/customer/app/feedback/getFeedbackDetial`,data, {
      crypto: false
    }),
    //系统消息
    systemInfo:data => jsBridge.http(`${testurl}/customer/app/message/getSysMessageList`,data, {
      crypto: false
    }),
    //系统消息详情
    systemInfoDetail:data => jsBridge.http(`${testurl}/customer/app/noticeAlert/getSysNoticeDetailApp`,data, {
      crypto: false
    }),
    //资讯消息
    zixunInfo:data => jsBridge.http(`${testurl}/customer/app/message/getInfoMessageList`,data, {
      crypto: false
    }),
    //资讯消息状态
    zixunInfoStatus:data => jsBridge.http(`${testurl}/customer/app/message/readInfo`,data, {
      crypto: false
    }),
    //将所有的反馈标记为已读
    setfeedbackallread:data => jsBridge.http(`${testurl}/customer/app/feedback/setAllFeedbackRead`,data, {
      crypto: false
    }),
    //将所有系统消息标记为已读
    setsystemsallread:data => jsBridge.http(`${testurl}/customer/app/message/readSysAll`,data, {
      crypto: false
    }),
    //将所有资讯消息标记为已读
    setzixunallread:data => jsBridge.http(`${testurl}/customer/app/message/readInfoAll`,data, {
      crypto: false
    }),
  },
  //分享
  infoShare:{
    share:data => jsBridge.http(`${testurl}/customer/app/information/share`,data, {
      crypto: false
    })
  },
  //经济日历
  indexCalendar:{
    selectNewsCalendarList:data => jsBridge.http(`${testurl}/customer/app/infoIndex/selectNewsCalendarList`,data, {
      crypto: false
    }),
  },
  //资讯
  realTimeInfo:{
    //资讯列表页面(科创板，公司能见度，市场，机构，宏观)
    getinfoList:data => jsBridge.http(`${testurl}/customer/app/information/getInformationList`,data, {
      crypto: false
    }),
    //获取资讯详情列表
    getInfoDetails:data => {
      return jsBridge.http(`${testurl}/customer/app/information/getInformationDetail`,data, {
        crypto: false
      })
    },
    //获取关注状态（需要单独获取）
    getFollow:data => {
      return jsBridge.http(`${testurl}/customer/app/information/getFollowStatus`,data, {
        crypto: false
      })
    },
    //更新资讯关注状态
    updateFollow:data => {
      return jsBridge.http(`${testurl}/customer/app/information/updateFollow`,data, {
        crypto: false
      })
    },
    //更新资讯点赞状态
    updatePriase:data => {
      return jsBridge.http(`${testurl}/customer/app/information/updateThumbup`,data, {
        crypto: false
      })
    },
    //更新资讯的收藏状态
    updateCollectdata:data => {
      return jsBridge.http(`${testurl}/customer/app/information/updateCollection`,data, {
        crypto: false
      })
    },
    //资讯的全局搜索
    getSearchList:data => {
      return jsBridge.http(`${testurl}/customer/app/information/getSearchList`,data, {
        crypto: false
      })
    },
    //智能视讯证券代码或简称搜索
    getSConsultingSearchList: data => {
      return jsBridge.http(`${testurl}/customer/app/video/getSearchIntelligentVideo`, data, {
        crypto: false
      })
    },
    //获取股票涨跌
    getRatePoint:data => {
      // return jsBridge.http(`http://dev11.jd.com:82/api/quotation/get_snapshot`,data, {
      return jsBridge.http(`${elseurl}/api/quotation/get_snapshot`,data, {
        crypto: false
      })
    },
    //获取股票涨跌新
    getSimpleQuoteUseUniqueCodes:data => {
      return jsBridge.http(`${testurl}/customer/app/searchMarket/getSimpleQuoteUseUniqueCodes`,data, {
        crypto: false
      })
    },

    selectPrizeInfoList:data => jsBridge.http(`${testurl}/customer/app/taurus/selectPrizeInfoList`, data, {
      crypto: false
    }),
  },
  //快讯
  newsflash:{
    newsflashdetails:data => jsBridge.http(`${testurl}/customer/app/information/getFlashDetail`,data, {
      crypto: false
    }),
    //获取快讯分享图片地址
    getnewsflashimg:data => jsBridge.http(`${testurl}/customer/app/information/getFlashUrlById`,data, {
      crypto: false
    })
  },
  // 财讯
  financialNews: {
    getFinancialDetail: data => jsBridge.http(`${testurl}/customer/app/information/getFinancialDetail`,data, {
      crypto: false
    })
  },
  // 金牛奖搜索
  taurusAward: {
    queryRelationInfo:data => jsBridge.http(`${testurl}/customer/app/taurus/queryRelationInfo`,data, {
      crypto: false
    }),
  },
  //行情搜索
  hqSearch:{
    getRate:data => jsBridge.http(`${testurl}/customer/app/indexSearch/getSecuritiesInfo`,data, {
      crypto: false
    }),
    //添加自选
    addRate:data => jsBridge.http(`${testurl}/customer/app/optional/insertOptionalStock`,data, {
      crypto: false
    }),
    //删除自选
    deleteRate:data => jsBridge.http(`${testurl}/customer/app/optional/updateOptionalStockList`,data, {
      crypto: false
    }),
  },
  //相关推荐
  recomendInfo:{
    //获取资讯详情里的相关推荐
    getRecomentList:data => jsBridge.http(`${testurl}/customer/app/information/getMoreList`,data, {
      crypto: false
    }),
  },
  //增加互动
  addInteraction:{
    //增加传闻求证
    addhearsay:data => jsBridge.http(`${testurl}/customer/app/interaction/addConfirmRumour`,data, {
      crypto: false
    }),
    addtopic:data => jsBridge.http(`${testurl}/customer/app/interaction/addTopic`,data, {
      crypto: false
    }),
  },
  //根据根据应用编码(funcCode)获取互动列表接口，其中互动包括（交易所互动，公司发声，记者采访，热门话题，传闻求证）
  InteractionList:{
    getDetails:data => jsBridge.http(`${testurl}/customer/app/interaction/getListByFuncCode`,data, {
      crypto: false
    }),
  },
  //根据ID获取互动详情（合并）即互动二级页面点击进入对应得三级页面，传infoId
  InteractionDDetails:{
    getDetails:data => jsBridge.http(`${testurl}/customer/app/interaction/getDetailByInfoId`,data, {
      crypto: false
    }),
  },
  //互动的点赞
  //点赞里面的status传值根据获取的status判断,如果获取的是状态是0那么传值传1,获取的是1则传0
  InteractionPriase:{
    updatePriase:data => jsBridge.http(`${testurl}/customer/app/interaction/updateThumbup`,data, {
      crypto: false
    }),
  },
  //互动评论
  InteractionDDetailsComment:{
    //获取互动详情的一级评论列表
    getcomment:data => jsBridge.http(`${testurl}/customer/app/interaction/getTopicCommentList`,data, {
      crypto: false
    }),
    //获取二级评论列表
    getSecondComment:data => jsBridge.http(`${testurl}/customer/app/interaction/getCommentDetail`,data, {
      crypto: false
    }),
    //增加评论，包含一级和二级
    addComment:data => jsBridge.http(`${testurl}/customer/app/interaction/addComment`,data, {
      crypto: false
    }),
  },
  //获取科创板，公司能见度，市场，机构，宏观（都是list）互动模块
  getElseList:{
    getList:data => jsBridge.http(`${testurl}/customer/app/interaction/getDetailByInfoId`,data, {
      crypto: false
    }),
    //互动的全局查询
    getSearchList:data => jsBridge.http(`${testurl}/customer/app/interaction/getSearchList`,data, {
      crypto: false
    }),
  },
  //获取专题相关
  specialInfo:{
    specialList:data => jsBridge.http(`${testurl}/customer/app/information/getProjectList`,data, {
      crypto: false
    }),
    specialInfoList:data => jsBridge.http(`${testurl}/customer/app/information/getProjectInfoList`,data, {
      crypto: false
    }),
  },
  //视频相关
  getVideoList:{
    searchList:data => jsBridge.http(`${testurl}/customer/app/video/getSearchList`,data, {
      crypto: false
    }),
    chapterList:data => jsBridge.http(`${testurl}/customer/app/video/getVideoList`,data, {
      crypto: false
    }),
    videoDetail:data => jsBridge.http(`${testurl}/customer/app/video/getVideoDetail`,data, {
      crypto: false
    }),
    //获取视频footer的点赞状态
    getfooterPriase:data => jsBridge.http(`${testurl}/customer/app/information/getThumbupStatus`,data, {
      crypto: false
    }),
    //更新点赞状态
    updatestatus:data => jsBridge.http(`${testurl}/customer/app/information/updateThumbup`,data, {
      crypto: false
    }),
    //获取视频收藏状态
    getfooterCollet:data => jsBridge.http(`${testurl}/customer/app/information/getCollectionStatus`,data, {
      crypto: false
    }),
    //更新收藏状态
    updaCollectestatus:data => jsBridge.http(`${testurl}/customer/app/information/updateCollection`,data, {
      crypto: false
    }),
    //首页的获取更多视频
    getMoreVideo:data => jsBridge.http(`${testurl}/customer/app/video/getMostVideoListByFuncCode`,data, {
      crypto: false
    }),
    //获取精选视频列表
    getselectedVideoList:data => jsBridge.http(`${testurl}/customer/app/video/getVideoColumnListByTrainingType`,data, {
      crypto: false
    }),
    //获取直播视频列表
    getlivebroadcastList:data => jsBridge.http(`${testurl}/customer/app/video/getVideoColumnListByTrainingType`,data, {
      crypto: false
    }),
  },
  //获取路演，盘面分析，金牛会客厅，中正大学
  getElseVideoList:{
    //获取头部简介
    getApplicationVideoList:data => jsBridge.http(`${testurl}/customer/app/video/getApplicationVideoList`,data, {
      crypto: false
    }),
    //获取视频列表
    getVideoColumnList:data => jsBridge.http(`${testurl}/customer/app/video/getVideoColumnList`,data, {
      crypto: false
    }),
  },
  //资讯评论
  informationcommentList:{
    getComment:data => jsBridge.http(`${testurl}/customer/app/information/getCommentList`,data, {
      crypto: false
    }),
    addcomment1:data => jsBridge.http(`${testurl}/customer/app/video/addComment`,data, {
      crypto: false
    }),
    addcomment:data => jsBridge.http(`${testurl}/customer/app/information/addComment`,data, {
      crypto: false
    }),
    //删除评论
    deleteComment:data => jsBridge.http(`${testurl}/customer/app/updateCommentStatus`,data, {
      crypto: false
    }),
    //获取资讯的点赞 收藏 以及评论数量
    getInformationCnt:data => jsBridge.http(`${testurl}/customer/app/information/getInformationCnt`,data, {
      crypto: false
    }),
  },
  //
  login: {
    // 登录页面相关接口
    getPhoneCaptcha: data => jsBridge.http(`${GATEWAY_SERVER}/uc/sys/captcha`, data, {
      crypto: true
    }),
    mobileLogin: data => jsBridge.http(`${GATEWAY_SERVER}/uc/n/mobileLogin`, data, {
      contentType: ContentType.FORM,
      crypto: true
    })
  },
  // 资讯首页相关接口
  infoIndex: {
    // 获取菜单列表
    getMenuList: data => jsBridge.http(`${JT2_SERVER}/infoIndex/selectSysFunctionList`, data),
    // 获取轮播图数据
    getRotation: data => jsBridge.http(`${JT2_SERVER}/infoIndex/getRotionChartList`, data),
    // 获取资讯推荐列表数据
    getInfoList: data => jsBridge.http(`${JT2_SERVER}/infoIndex/getRecList`, data),
    // 通过专题code获取列表数据
    getInfoListByFuncCode: data => jsBridge.http(`${JT2_SERVER}/infoIndex/getInfoListByFuncCode`, data),
    // 获取经济日历数据
    getCalendarData: data => jsBridge.http(`${JT2_SERVER}/infoIndex/selectNewsCalendarList`, data),
    // 获取股票行情数据
    getStockInfo: data => jsBridge.http(`${JR_GATEWAY_SERVER}/gw/generic/jrm/h5/m/queryRotateIndex`, data, {
      contentType: ContentType.FORM
    }),
    getLoadShare: data => jsBridge.http(`${JT2_SERVER}/infoIndex/getLoadShare`, data),
  },
  // 数据首页相关接口
  dataIndex: {
    // 获取数据下的应用
    getApplicationData: data => jsBridge.http(`${JT2_SERVER}/info/getApplications`, data),
    // 获取轮播图数据
    getRotionChartList: data => jsBridge.http(`${JT2_SERVER}/indexData/getRecommend`, data),
    // 跟进图表编码查询图表信息
    qrySubTopicDataSet: data => jsBridge.http(`${DRS_SERVER}/subTopic/qrySubTopicDataSet`, data),
    // 获取上市公司财报解读数据
    getFinancialReportData: data => jsBridge.http(`${JT2_SERVER}/indexData/getAppInancialReport`, data)
  },
  // 研究首页相关接口
  researchIndex: {
    // 处理行业专题数据
    getIndustryTopicList: data => jsBridge.http(`${JT2_SERVER}/industry/getIndustryTopicList`, data),
    // 处理产业链分类
    getIndustryList: data => jsBridge.http(`${JT2_SERVER}/indexResearch/getIndustrialChainClass`, data),
    // 产业链列表处理
    getIndustrialChainInfos: data => jsBridge.http(`${JT2_SERVER}/indexResearch/getIndustrialChainInfos`, data),
    //查询研报列表
    getInfoListForResearch: data => jsBridge.http(`${JT2_SERVER}/indexResearch/getInfoListForResearch`, data),
    // 研报专题列表（目前查詢100个）
    getResearchTopicInfos: data => jsBridge.http(`${JT2_SERVER}/indexResearch/getResearchTopicInfos`, data),
    // 研报专题列表（目前查詢100个）
    getWordParam: data => jsBridge.http(`${JT2_SERVER}/indexResearch/getWordParam`, data),
    // 获取今日股市信息
    getStockList: data => jsBridge.http(`${JT2_SERVER}/indexResearch/getStockList`, data)
  },
  // 查询页面
  search: {
    //搜索应用
    getApplicationInfoByName: data => jsBridge.http(`${JT2_SERVER}/indexSearch/getApplicationInfoByName`, data),
    //搜索资讯列表
    getInfoListSearchByEs: data => jsBridge.http(`${JT2_SERVER}/indexSearch/getInfoListSearchByEs`, data),
    //搜索资讯列表
    goInfoSearch: data => jsBridge.http(`${JT2_SERVER}/indexSearch/getInfoListSearchByEs`, data),
    //搜索快讯、快评列表
    goNewsSearch: data => jsBridge.http(`${JT2_SERVER}/indexSearch/getInfoListSearchByEs`, data),
    //搜索数据图表
    getDataSearchTable: data => jsBridge.http(`${JT2_SERVER}/indexSearch/getDataSearchTable`, data),
    //搜索数据模块图表数据
    goDataSearch: data => jsBridge.http(`${JT2_SERVER}/indexSearch/getDataSearchTable`, data),
    //搜索股票行情信息
    getSecuritiesInfo: data => jsBridge.http(`${JT2_SERVER}/indexSearch/getSecuritiesInfo`, data),
    //搜索研报列表
    getInfoListForSearch: data => jsBridge.http(`${JT2_SERVER}/indexSearch/getInfoListForSearch`, data),
    //搜索精选视频列表
    getInfoListForVoide: data => jsBridge.http(`${JT2_SERVER}/indexSearch/getInfoListForVoide`, data),
    //搜索BAS报价
    searchByKey: data => jsBridge.http(`${FICC_SERVER}/security/searchByKey.do`, data),
    //搜索行业专题
    getIndustryTopicByName: data => jsBridge.http(`${JT2_SERVER}/industry/getIndustryTopicByName`, data),
    //搜索研究模块
    getReportSearch: data => jsBridge.http(`${JT2_SERVER}/indexSearch/getReportSearch`, data)
  },
  searchCharts: {
    //搜索数据图表
    getDataSearchTable: data => jsBridge.http(`${JT2_SERVER}/searchCharts/getDataSearchTable`, data),
  },
  indexSearch: {
    //获取搜索热词
    getHotWord: data => jsBridge.http(`${JT2_SERVER}/indexSearch/getHotWord`, data),
  },
  industrialChain: {
    //搜索产业链
    getIndustrialChain: data => jsBridge.http(`${JT2_SERVER}/indChain/getIndustrialChain`, data),
  },
  searchMarket: {
    //搜索股票行情信息
    getSecuritiesInfo: data => jsBridge.http(`${JT2_SERVER}/indexSearch/getSecuritiesInfo`, data),
  },
  searchResearch: {
    //搜索研报列表
    getInfoListForSearch: data => jsBridge.http(`${JT2_SERVER}/searchResearch/getInfoListForSearch`, data),
  },
  searchVoice: {
    //搜索音频列表
    getInfoListForVoice: data => jsBridge.http(`${JT2_SERVER}/searchVoice/getInfoListForVoice`, data),
  },
  searchVoide: {
    //搜索精选视频列表
    getInfoListForVoide: data => jsBridge.http(`${JT2_SERVER}/searchVoide/getInfoListForVoide`, data),
  },
  // 资讯详情相关接口
  infoDetail: {
    // 获取资讯详情
    getInfoDetail: data => {
      let requestUrl = `${GATEWAY_SERVER}/getInformationDetail`
      // 如果是本地的web开发，直接访问jt2地址
      if (dict.ENV === 'dev' && platform === 'web') {
        requestUrl = `${JT2_SERVER}/infoDetail/getInformationDetail`
      }

      if (platform === 'web') {
        //分享后渠道记录,如果是web打开，渠道记录为JT2_APP_SHARE
        data.channel = 'JT2_APP_SHARE'
      }
      return jsBridge.http(requestUrl, data, {
        method: METHOD.POST,
        crypto: false,
        cache: {
          preKey: 'detail',
          cacheKey: 'infoId',
          checkKey: 'modifyDttm',
          postKey: 'updateTime'
        }
      })
    },
    // 获取资讯延伸阅读
    getInfoListSearch: data => {
      let requestUrl = `${GATEWAY_SERVER}/getInfoListSearch`
      // 如果是本地的web开发，直接访问jt2地址
      if (dict.ENV === 'dev' && platform === 'web') {
        requestUrl = `${JT2_SERVER}/infoDetail/getInfoListSearch`
      }

      return jsBridge.http(requestUrl, data)
    },
    // 查看资讯收藏状态
    findCollectStatus: data => jsBridge.http(`${JT2_SERVER}/infoDetail/findCollectStatus`, data),
    // 资讯点击收藏
    addOrModifyCollectionInfo: data => jsBridge.http(`${JT2_SERVER}/infoDetail/addOrModifyCollectionInfo`, data),
    // 查看资讯点赞状态
    queryThumbStauts: data => jsBridge.http(`${JT2_SERVER}/infoDetail/queryThumbStauts`, data),
    // 点赞资讯
    updateThumbsupInfo: data => jsBridge.http(`${JT2_SERVER}/infoDetail/updateThumbsupInfo`, data),
    // 资讯添加评论
    addCommentInfo: data => jsBridge.http(`${JT2_SERVER}/infoDetail/addCommentInfo`, data),
    // 获取评论数点赞数
    getCommentInfo: data => {
      let requestUrl = `${GATEWAY_SERVER}/getCommentInfo`
      // 如果是本地的web开发，直接访问jt2地址
      if (dict.ENV === 'dev' && platform === 'web') {
        requestUrl = `${JT2_SERVER}/infoDetail/getCommentInfo`
      }

      return jsBridge.http(requestUrl, data)
    },
    // 获取涨跌幅
    getSnapshot: data => jsBridge.http(`${BASE_SERVER}/api/quotation/get_snapshot`, data),
  },
  //评论 comment start
  //评论列表
  commentList: {
    // 获取评论列表
    getComments: data => jsBridge.http(`${JT2_SERVER}/commentList/getComments`, data),
    // 添加评论
    addCommentInfo: data => jsBridge.http(`${JT2_SERVER}/commentList/addCommentInfo`, data),
    // 评论点赞
    fabulous: data => jsBridge.http(`${JT2_SERVER}/commentList/updateThumbsupInfo`, data),
    // 评论删除
    delComment: data => jsBridge.http(`${JT2_SERVER}/commentList/updateCommentStatus`, data),
  },
  // 更多评论
  commentMore: {
    // 获取评论
    getComments: data => jsBridge.http(`${JT2_SERVER}/commentMore/getComments`, data),
    // 评论点赞
    updateThumbsupInfo: data => jsBridge.http(`${JT2_SERVER}/commentMore/updateThumbsupInfo`, data),
    // 评论添加
    addCommentInfo: data => jsBridge.http(`${JT2_SERVER}/commentMore/addCommentInfo`, data),
    // 评论删除
    updateCommentStatus: data => jsBridge.http(`${JT2_SERVER}/commentMore/updateCommentStatus`, data),
  },
  //评论 comment end
  //data start
  absCalculator: {
    // 计算器页面查询债券详情
    queryDetail: data => jsBridge.http(`${FICC_SERVER}/abs/calc/queryDetail.do`, data),
    // 获得现金流信息
    shareCashflow: data => jsBridge.http(`${FICC_SERVER}/abs/calc/shareCashflow.do`, data),
    //统一的ABS计算接口
    imCalc: data => jsBridge.http(`${FICC_SERVER}/abs/calc/imCalc.do`, data),
  },
  absDetail: {
    //ABS报价-获取ABS报价 已登录
    userQuotations: data => jsBridge.http(`${FICC_SERVER}/abs/user-quotations`, data),
    //ABS报价-获取ABS报价 未登录
    quotations: data => jsBridge.http(`${FICC_SERVER}/abs/quotations`, data),
    // 查看是否有计算能力
    checkAbsCalc: data => jsBridge.http(`${FICC_SERVER}/abs/calc/checkAbsCalc.do`, data),
    //获取债券详情 已登录
    detail: data => jsBridge.http(`${FICC_SERVER}/security/mp-user/detail`, data),
    //获取债券详情 未登录
    mapDetail: data => jsBridge.http(`${FICC_SERVER}/security/mp/detail`, data),
    // 获取报价联系方式
    makerContact: data => jsBridge.http(`${FICC_SERVER}/abs/maker-contact`, data),
  },
  absList: {
    //ABS报价-获取ABS报价 已登录
    userQuotations: data => jsBridge.http(`${FICC_SERVER}/abs/user-quotations`, data),
    //ABS报价-获取ABS报价 未登录
    quotations: data => jsBridge.http(`${FICC_SERVER}/abs/quotations`, data),
    //ABS数据查询
    searchByKey: data => jsBridge.http(`${FICC_SERVER}/security/searchByKey.do`, data),
  },
  calculatorIndex: {
    // 查看是否有计算能力
    checkAbsCalc: data => jsBridge.http(`${FICC_SERVER}/abs/calc/checkAbsCalc.do`, data),
  },
  calculatorSearch: {
    //ABS数据查询
    searchByKey: data => jsBridge.http(`${FICC_SERVER}/abs/calc/searchByKey.do`, data),
    // 查看是否有计算能力
    checkAbsCalc: data => jsBridge.http(`${FICC_SERVER}/abs/calc/checkAbsCalc.do`, data),
  },
  financialReport: {
    // 上市公司财报解读
    getAppInancialReport: data => jsBridge.http(`${JT2_SERVER}/indexData/getAppInancialReport`, data),
  },
  tableDetail: {
    // 获取图表数据信息
    qrySubTopicDataSet: data => jsBridge.http(`${DRS_SERVER}/subTopic/qrySubTopicDataSet`, data),
    getChartsInfoByKey: data => jsBridge.http(`${JT2_SERVER}/tableDetail/getChartsInfoByKey`, data),
    // 查看用户是否已收藏
    findCollectStatus: data => jsBridge.http(`${JT2_SERVER}/tableDetail/findCollectStatus`, data),
  },
  tableList: {
    // 查询图表信息
    getChartsInfo: data => jsBridge.http(`${JT2_SERVER}/menu/getChartsInfo`, data),
    // 获取图表数据信息
    qrySubTopicDataSet: data => jsBridge.http(`${DRS_SERVER}/subTopic/qrySubTopicDataSet`, data),
    // 查询应用菜单信息
    getApplicationMenus: data => jsBridge.http(`${JT2_SERVER}/menu/getApplicationMenus`, data),
    //图表的收藏、取消收藏
    addOrModifyCollectionInfo: data => jsBridge.http(`${JT2_SERVER}/menu/addOrModifyCollectionInfo`, data),
  },
  //data end
  // home start
  homeChain: {
    // 查询推荐产业链
    getRecommendChainList: data => jsBridge.http(`${JT2_SERVER}/homeChain/getRecommendChainList`, data),
    // 获取产业链图表信息
    queryMasterGraph: data => jsBridge.http(`${BASE_SERVER}/api/sam/chainIndustry/v2/queryMasterGraph`, data),
  },
  indexVideo: {
    // 直播轮播图
    getLiveTrainList: data => jsBridge.http(`${JT2_SERVER}/indexVideo/getLiveTrainList`, data),
    // 精选视频列表
    getRecTrainList: data => jsBridge.http(`${JT2_SERVER}/indexVideo/getRecTrainList`, data),
    // 大咖列表
    getBigShotList: data => jsBridge.http(`${JT2_SERVER}/indexVideo/getBigShotList`, data),
    // 获取系列专题信息
    getVideoSeries: data => jsBridge.http(`${JT2_SERVER}/indexVideo/getVideoSeries`, data),
  },
  stockDetail: {
    // 获取音频详情
    getStockDetailById: data => jsBridge.http(`${JT2_SERVER}/stockDetail/getStockDetailById`, data),
    //获取音频列表
    getStockList: data => jsBridge.http(`${JT2_SERVER}/stockDetail/getStockList`, data),
    // 音频点赞
    updateThumbsupInfo: data => jsBridge.http(`${JT2_SERVER}/stockDetail/updateThumbsupInfo`, data),
    // 查看音频点赞状态
    queryThumbStauts: data => jsBridge.http(`${JT2_SERVER}/stockDetail/queryThumbStauts`, data),
  },
  stockList: {
    // 获取音频列表
    getStockList: data => jsBridge.http(`${testurl}/customer/app/stockList/getStockList`, data),
  },
  // home end
  // info start
  flashDetail: {
    // 获取快讯明细
    getNewsFlashDetail: data => jsBridge.http(`${JT2_SERVER}/flashDetail/getNewsFlashDetail`, data),
    // 延伸阅读
    getInfoListSearch: data => jsBridge.http(`${JT2_SERVER}/flashDetail/getInfoListSearch`, data),
    // 查看收藏状态
    findCollectStatus: data => jsBridge.http(`${JT2_SERVER}/flashDetail/findCollectStatus`, data),
    // 快讯点击收藏
    addOrModifyCollectionInfo: data => jsBridge.http(`${JT2_SERVER}/flashDetail/addOrModifyCollectionInfo`, data),
    // 查看快讯点赞状态
    queryThumbStauts: data => jsBridge.http(`${JT2_SERVER}/flashDetail/queryThumbStauts`, data),
    // 点赞快讯
    updateThumbsupInfo: data => jsBridge.http(`${JT2_SERVER}/flashDetail/updateThumbsupInfo`, data),
    // 快讯添加评论
    addCommentInfo: data => jsBridge.http(`${JT2_SERVER}/flashDetail/addCommentInfo`, data),
    // 获取评论点赞数
    getCommentInfo: data => jsBridge.http(`${JT2_SERVER}/flashDetail/getCommentInfo`, data),
  },
  // indexCalendar: {
  //   // 获取财经数据列表
  //   selectNewsCalendarList: data => jsBridge.http(`${JT2_SERVER}/infoIndex/selectNewsCalendarList`, data),
  // },
  indexFlash: {
    // 快评列表
    getNewsListForThird: data => jsBridge.http(`${JT2_SERVER}/indexFlash/getNewsListForThird`, data),
  },
  topicDetail: {
    // 获取专题详情
    selectFuncInfoByFuncCode: data => jsBridge.http(`${JT2_SERVER}/topicDetail/selectFuncInfoByFuncCode`, data),
    // 根据funcCode获取资讯列表
    getInfoListByFuncCode: data => jsBridge.http(`${JT2_SERVER}/topicDetail/getInfoListByFuncCode`, data),
  },
  topicList: {
    // 获取专题列表信息
    getTopicList: data => jsBridge.http(`${JT2_SERVER}/topicList/getTopicList`, data),
  },
  // info end
  // research start
  indexReport: {
    // 获取研报列表
    getInfoListForResearch: data => jsBridge.http(`${JT2_SERVER}/indexReport/getInfoListForResearch`, data),
    // 获取研报专题列表
    getResearchTopicInfos: data => jsBridge.http(`${JT2_SERVER}/indexReport/getResearchTopicInfos`, data),
    // 获取来源
    getWordParam: data => jsBridge.http(`${JT2_SERVER}/indexReport/getWordParam`, data),
  },
  industrialDetail: {
    // 产业链详情图谱
    queryMasterGraph: data => jsBridge.http(`${BASE_SERVER}/api/sam/chainIndustry/v2/queryMasterGraph`, data),
    // 相关企业列表
    vertexEntBasicInfo: data => jsBridge.http(`${BASE_SERVER}/api/sam/chainIndustryEnt/vertexEntBasicInfo`, data),
    // 根据产业链关键词查询产业链跳转路径
    getChainByKey: data => jsBridge.http(`${JT2_SERVER}/industrialDetail/getChainByKey`, data),

  },
  industrialMap: {
    // 查询产业链列表
    getIndustrialChainList: data => jsBridge.http(`${JT2_SERVER}/industrialMap/getIndustrialChainList`, data),
  },
  industry: {
    // 获取图表数据信息
    qrySubTopicDataSet: data => jsBridge.http(`${DRS_SERVER}/subTopic/qrySubTopicDataSet`, data),
    //债券分析基本信息
    qrySubTopicTableSet: data => jsBridge.http(`${DRS_SERVER}/subTopic/qrySubTopicTableSet`, data),
    //股票分析基本信息
    qryStockInfoBySubtopicCode: data => jsBridge.http(`${DRS_SERVER}/subTopic/qryStockInfoBySubtopicCode`, data),
    //获取公司评估信息
    queryCompanyRateList: data => jsBridge.http(`${DRS_SERVER}/companyRate/queryCompanyRateList`, data),
  },
  industryFiqs: {
    // FIQS评级
    queryCompanyRateList: data => jsBridge.http(`${DRS_SERVER}/companyRate/queryCompanyRateList`, data),
  },
  reportDetail: {
    // 获取研报明细
    getFileDetail: data => jsBridge.http(`${JT2_SERVER}/reportDetail/getFileDetail`, data),
    // 研报延伸阅读
    getInfoListForResearch: data => jsBridge.http(`${JT2_SERVER}/reportDetail/getInfoListForResearch`, data),
    // 查看研报收藏状态
    findCollectStatus: data => jsBridge.http(`${JT2_SERVER}/reportDetail/findCollectStatus`, data),
    // 研报点击收藏
    addOrModifyCollectionInfo: data => jsBridge.http(`${JT2_SERVER}/reportDetail/addOrModifyCollectionInfo`, data),
    // 查看研报点赞状态
    queryThumbStauts: data => jsBridge.http(`${JT2_SERVER}/reportDetail/queryThumbStauts`, data),
    // 研报点赞
    updateThumbsupInfo: data => jsBridge.http(`${JT2_SERVER}/reportDetail/updateThumbsupInfo`, data),
    // 研报添加评论
    addCommentInfo: data => jsBridge.http(`${JT2_SERVER}/reportDetail/addCommentInfo`, data),
    // 获取评论数点赞数
    getCommentInfo: data => jsBridge.http(`${JT2_SERVER}/reportDetail/getCommentInfo`, data),
  },
  reportSpecial: {
    // 获取研报专题详情
    getResearchTopicInfo: data => jsBridge.http(`${JT2_SERVER}/reportSpecial/getResearchTopicInfo`, data),
    // 获取研报列表
    getInfoListForResearch: data => jsBridge.http(`${JT2_SERVER}/reportSpecial/getInfoListForResearch`, data),
  },
  // research end
  // video start
  bigshotDetail: {
    //根据id查询大咖信息
    getCharacterById: data => jsBridge.http(`${JT2_SERVER}/bigshotDetail/getCharacterById`, data),
    //查询大咖的视频列表
    getTrainListByFuncCode: data => jsBridge.http(`${JT2_SERVER}/bigshotDetail/getTrainListByFuncCode`, data),
  },
  bigshotVideo: {
    // 查询大咖
    selectCharacterAll: data => jsBridge.http(`${JT2_SERVER}/bigshotVideo/selectCharacterAll`, data),
  },
  featuredVideo: {
    // 精选视频列表加载
    getRecTrainList: data => jsBridge.http(`${JT2_SERVER}/featuredVideo/getRecTrainList`, data),
  },
  seriesTopics: {
    // 获取系列专题信息
    selectSysFuncInfoByParent: data => jsBridge.http(`${JT2_SERVER}/seriesTopics/selectSysFuncInfoByParent`, data),
  },
  specialVideo: {
    //查询系列专题详情
    selectFuncInfoByFuncCode: data => jsBridge.http(`${JT2_SERVER}/specialVideo/selectFuncInfoByFuncCode`, data),
    //查询系列专题列表
    getTrainListByFuncCode: data => jsBridge.http(`${JT2_SERVER}/specialVideo/getTrainListByFuncCode`, data),
  },
  videoLive: {
    // 查询直播详情
    selectTrainingInfoByInfoId: data => jsBridge.http(`${JT2_SERVER}/videoLive/selectTrainingInfoByInfoId`, data),
  },
  videoVod: {
    // 获取录播详情
    getTrainingInfoByInfoId: data => jsBridge.http(`${JT2_SERVER}/videoVod/getTrainingInfoByInfoId`, data),
  },
  // video end

  //user start
  // 版本号页面相关接口
  indexUser: {
    // 获取当前用户反馈消息中已答复未阅读的数量
    getUnreadNums: data => jsBridge.http(`${JT2_SERVER}/messageHome/getUnreadNums`, data)
  },
  // 版本号页面相关接口
  version: {
    // 获取当前最新版本号
    getMaxVersionNum: data => jsBridge.http(`${JT2_SERVER}/version/getMaxVersionNum`, data)
  },
  // 版本更新动态页面相关接口
  versionHistory: {
    // 获取历史版本更新信息
    getVersionHisList: data => jsBridge.http(`${JT2_SERVER}/versionHistory/getVersionHis`, data)
  },
  // 我的消息页面相关接口
  messageHome: {
    // 获取当前用户反馈消息中已答复未阅读的数量
    getUnreadNums: data => jsBridge.http(`${JT2_SERVER}/messageHome/getUnreadNums`, data),
    // 获取当前用户反馈消息中最新已答复未阅读的答复时间与标题
    getLastUnreadTimeTitle: data => jsBridge.http(`${JT2_SERVER}/messageHome/getLastUnreadTimeTitle`, data),
    // 获取当前用户反馈消息中最新的反馈标题
    getLastInfoTitle: data => jsBridge.http(`${JT2_SERVER}/messageHome/getLastInfoTitle`, data),
    //将所有已答复未阅读（status：2）的反馈消息改为已答复已阅读（status: 3)
    setAllFeedbackRead: data => jsBridge.http(`${JT2_SERVER}/messageHome/setAllFeedbackRead`, data),
    // 获取用户信息
    getAppUserInfo: data => jsBridge.http(`${JT2_SERVER}/messageHome/getAppUserInfo`, data),
  },
  // 资讯消息页面相关接口
  messageInfo: {
    // 新增用户阅读日志
    insertMessageReadLogRedis: data => jsBridge.http(`${JT2_SERVER}/redis/insertMessageReadLogRedis`, data),
  },
  // 公告页面相关接口
  notice: {
    // 新增用户阅读日志
    insertMessageReadLogRedis: data => jsBridge.http(`${JT2_SERVER}/redis/insertMessageReadLogRedis`, data),
  },
  noticeDetail: {
    //获取单条公告的标题与内容
    getAppShowSysNotice: data => jsBridge.http(`${JT2_SERVER}/noticeDetail/getAppShowSysNotice`, data)
  },
  noticeAlert: {
    //获取公告弹窗显示数据
    selectSysNoticeById: data => jsBridge.http(`${JT2_SERVER}/noticeAlert/selectSysNoticeById`, data),
    //获取当前需要弹窗的公告
    getAlertSysNotice: data => jsBridge.http(`${JT2_SERVER}/noticeAlert/getAlertSysNotice`, data)
  },
  editPersonal: {// 账户信息修改
    // 获取用户信息
    getAppUserInfo: data => jsBridge.http(`${JT2_SERVER}/editPersonal/getAppUserInfo`, data),

    // 修改用戶信息  headSculpture 头像； realName 姓名； email 邮箱； phone 座机； liveAddress 所在城市    // mobile 手机、
    updateAppUserInfo: data => jsBridge.http(`${JT2_SERVER}/editPersonal/updateAppUserInfo`, data),

  },
  changePassword: { //修改密码
    //修改密码
    retrievePwd: data => jsBridge.http(`${GATEWAY_SERVER}/uc/sys/retrievePwd`, data, {crypto: true}),
    getAppUserInfo: data => jsBridge.http(`${JT2_SERVER}/changePassword/getAppUserInfo`, data),
  },
  collection: {
    //查询用户收藏的资讯列表
    getCollectionInfoList: data => jsBridge.http(`${JT2_SERVER}/collection/getCollectionInfoList`, data),
    //获取图表数据信息
    qrySubTopicDataSet: data => jsBridge.http(`${DRS_SERVER}/subTopic/qrySubTopicDataSet`, data),
    //查询用户收藏的code列表
    getCollectionDataList: data => jsBridge.http(`${JT2_SERVER}/collection/getCollectionDataList`, data)
  },
  feedback: {
    //添加意见反馈
    addFeedback: data => jsBridge.http(`${JT2_SERVER}/feedback/addFeedback`, data),
    //获取意见反馈列表
    getFeedbackList: data => jsBridge.http(`${JT2_SERVER}/feedback/getFeedbackList`, data),
    //获取意见反馈详情
    getFeedbackDetial: data => jsBridge.http(`${JT2_SERVER}/feedback/getFeedbackDetial`, data)

  },
  helpCenter: {
    //获取问题列表
    getHelpCenterQuestion: data => jsBridge.http(`${JT2_SERVER}/helpCenter/getHelpCenterQuestion`, data),
    //获取问题答案
    getHelpCenterAnswer: data => jsBridge.http(`${JT2_SERVER}/helpCenter/getHelpCenterAnswer`, data)
  },
  newsSet: {
    // 获取用户信息
    getAppUserInfo: data => jsBridge.http(`${JT2_SERVER}/newsSet/getAppUserInfo`, data),
    //查询用户当前系统公告的消息接收状态
    getSysReceiveStateByUserId: data => jsBridge.http(`${JT2_SERVER}/newsSet/getSysReceiveStateByUserId`, data),
    //查询用户当前资讯的消息接收状态
    getInfoReceiveStateByUserId: data => jsBridge.http(`${JT2_SERVER}/newsSet/getInfoReceiveStateByUserId`, data),
    //查询用户当前资讯的消息接收频率
    getFrequencyByUserId: data => jsBridge.http(`${JT2_SERVER}/newsSet/getFrequencyByUserId`, data),
    //系统公告消息接收设置
    updateSysReceiveState: data => jsBridge.http(`${JT2_SERVER}/newsSet/updateSysReceiveState`, data),
    //资讯接收设置
    updateInfoReceiveState: data => jsBridge.http(`${JT2_SERVER}/newsSet/updateInfoReceiveState`, data),
    //资讯消息接收频率设置
    updateFrequency: data => jsBridge.http(`${JT2_SERVER}/newsSet/updateFrequency`, data),
    //查询数据库中是否存在有效的该用户的资讯设置信息
    getInfoStateNum: data => jsBridge.http(`${JT2_SERVER}/newsSet/getInfoStateNum`, data),
    //新增一条资讯设置信息
    insertInfoMsgSet: data => jsBridge.http(`${JT2_SERVER}/newsSet/insertInfoMsgSet`, data)
  },
  //user end
  topicPK: {
    //获取PK详情
    getPKDetail: data => jsBridge.http(`${JT2_SERVER}/pkDetail/getTopicPkDetail`, data),
    //获取评论列表
    getCommontList: data => jsBridge.http(`${JT2_SERVER}/pkDetail/getTopicpkCommentByIdeaContent`, data),
    //获取热门推荐列表
    getRecommentList: data => jsBridge.http(`${JT2_SERVER}/pkDetail/getTopicPkByIsRecommend`, data),
    //设置我的站队
    setMyOptions: data => jsBridge.http(`${JT2_SERVER}/topicList/addTopicPk`, data),
    //设置我的评论
    setMyComment: data => jsBridge.http(`${JT2_SERVER}/pkDetail/addTopicpkComment`, data),
    //点赞
    thumbsUp: data => jsBridge.http(`${JT2_SERVER}/pkDetail/updateThumbsup`, data),
    //获取所有PK话题
    getPKList: data => jsBridge.http(`${JT2_SERVER}/topicList/getTopicPkList`, data),
    //获取我的话题PK列表
    getMyPKList: data => jsBridge.http(`${JT2_SERVER}/topicList/getTopicPkListByUserId`, data)
  },
  changePhone: {
    // 更换手机号
    modifyMobile: data => jsBridge.http(`${GATEWAY_SERVER}/uc/user/modifyMobile`, data, {crypto: true}),
  },
  download: {
    getUpdateUrl: () => jsBridge.http(`${GATEWAY_SERVER}/system/getUpdateUrl`)
  },
  videoTopic: {

    // 查询合集信息
    getSpecialInfo:data => {
      return jsBridge.http(`${testurl}/customer/app/live/getSpecialInfo`,data, {
        crypto: false
      })
    },
    // 查询合集列表
    getSpecialList:data => {
      return jsBridge.http(`${testurl}/customer/app/live/getSpecialList`,data, {
        crypto: false
      })
    },
  },
  shareUrl:{
    getShareUrl:data => jsBridge.http(`${testurl}/customer/app/information/uploadQCCodeImage`,data, {
      crypto: false
    }),
  },
}
